<script lang="ts" setup>
import { dateZhCN, GlobalThemeOverrides, zhCN } from 'naive-ui'
import { onMounted } from 'vue'
import { use_ui_setting } from '@/state/pinia.ts'

const ui_setting = use_ui_setting()
const theme_overrides: GlobalThemeOverrides = {
    Button: {
        borderRadiusSmall: 0,
        borderRadiusTiny: 0,
        borderRadiusMedium: 0,
        borderRadiusLarge: 0,
    },
    Input: {
        borderRadius: 0,
        boxShadowFocus: 0,
    },
    InternalSelection: {
        borderRadius: 0,
        boxShadowActive: 0,
        boxShadowFocus: 0,
        boxShadowHover: 0,
    },
    Radio: {
        buttonBorderRadius: 0,
        boxShadowActive: 0,
        boxShadowFocus: 0,
        boxShadowHover: 0,
        boxShadow: 0,
        boxShadowDisabled: 0,
        buttonBoxShadow: 0,
        buttonBoxShadowFocus: 0,
        buttonBoxShadowHover: 0,
    },
    Checkbox: {
        boxShadowFocus: 0,
    },
}

onMounted(async () => {
    ui_setting.initialize()
})
</script>

<template>
    <n-config-provider :date-locale="dateZhCN" :locale="zhCN" :theme-overrides="theme_overrides">
        <n-message-provider :duration="1500">
            <router-view class="window" />
        </n-message-provider>
    </n-config-provider>
</template>

<style scoped>
.window {
    font-family: -apple-system, Roboto, '微软雅黑', 'Microsoft Sans Serif', 'Helvetica Neue', 'Open Sans', sans-serif, '黑体', '宋体';
    font-size: 14px;

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;

    padding: 15px;
}
</style>
